﻿function $(value){
 return document.getElementById(value);
}
//得到售票ID
function ticketOrderInfo() {
	this._WicketId; 
	this._result;
	this._current;
	//加载TAB1内容,售票点各种信息　
    this.loadWicketInfo = function()
    {
        if(this._result.PageCount==""){
			alert('no');
		}
        var oTable=$("Info").tBodies[0];
        while(oTable.rows.length>0){
            oTable.deleteRow();
			
        }    
		 var oFrament=document.createDocumentFragment();
		 var oTr=$("template").cloneNode(true);
		 oTr.style.display="block";
		 for(var i in this._result.PageContent)
		 {
		 	var oRow=oTr.cloneNode(true);		 	
//			oRow.childNodes[1].innerHTML="<a onclick='getInviteInfo()'>"+this._result.PageContent[i].JobConcreteName+"</a>";
			oRow.childNodes[2].firstChild.firstChild.innerText=this._result.PageContent[i].PublishDate;
			oRow.childNodes[2].childNodes[1].firstChild.innerText=this._result.PageContent[i].AvailabilityDate;
			oRow.id=this._result.PageContent[i].JobInfoID;
//			oRow.state=this._result.PageContent[i].PublishState;
			
			oFrament.appendChild(oRow);
		 }		
		 $("Info").tBodies[0].appendChild(oFrament);    }
    //加载TAB2内容.查询火车情况
    this.loadTrainInfo = function() {
        if (this._result.PageCount == "") {
            alert('no');
        }
        var oTable = $("Info").tBodies[0];
        while (oTable.rows.length > 0) {
            oTable.deleteRow();

        }
        var oFrament = document.createDocumentFragment();
        var oTr = $("template").cloneNode(true);
        oTr.style.display = "block";
        for (var i in this._result.PageContent) {
            var oRow = oTr.cloneNode(true); 
            oRow.id = this._result.PageContent[i].JobInfoID; 
            oFrament.appendChild(oRow);
        }
        $("Info").tBodies[0].appendChild(oFrament);
    }
    
    //加载TAB3内容.
    
    //加载TAB4内容.订单最后的情况显示..并提交订单        
        
}
var addWicketInfo = new addWicketInfo();
//得到出行城市 
function GetJobSort()
{
    AjaxWebService.AjaxWebService.GetAllCity();
}
function onGetJobSort(result)
{
    var text = new Array();
    var textId = new Array();
    for(var i = 0; i<result.length; i++ ) 
    {
        text[i] =  result[i].JobSortName;
        textId[i] = result[i].JobSortID;
    }
      AjaxWebService.AjaxWebService.GetAgentListByCity(textId[0],onGetJobConcrete);
}
//得到售票点
function GetJobConcrete()
{
    for (var i = 0; i< $("selecttradeinfo").firstChild.childNodes.length; i++)
    {
        if($("selecttradeinfo").firstChild.options[i].selected == true)
        {
            var jobSortID = $("selecttradeinfo").firstChild.options[i].value;
        }
    }
    //WebService.HR.GetJobConcrete(jobSortID,onGetJobConcrete); 
}
function onGetJobConcrete(result)
{
    var text = new Array();
    var textId = new Array();
    
    for(var i = 0; i<result.length; i++ ) 
    {
        text[i] =  result[i].JobConcreteName;
        textId[i] = result[i].JobConcreteID;
    }
     
}